package homework02;

import java.util.Arrays;
import java.util.Scanner;

public class Two {
	public static int num[];
	public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
		while(true)
		{
			String a = input.nextLine();
			switch(a)
			{
				case "fib" :
					String n = input.nextLine();
					for(int i=1;i<=Integer.parseInt(n);i++)
					{	if(i==1)System.out.print(fib(i));
						else System.out.print(" "+fib(i));
						}
					System.out.println();
					
					break;
				case "sort":
					String[] str1=input.nextLine().split(" ");
					num=new int[str1.length];
					for(int i=0;i<num.length;i++)
						num[i]=Integer.parseInt(str1[i]);
					Arrays.sort(num);
					System.out.println(Arrays.toString(num));
					break;
				case "search":
					String t = input.nextLine();
					int b=Integer.parseInt(t);
					if(Arrays.binarySearch(num,b)>=0)
						System.out.println(Arrays.binarySearch(num,b));
					else System.out.println(-1);
					break;
				case "getBirthDate":
					String ge = input.nextLine();
					int c=Integer.parseInt(ge);
					for(int i=0;i<c;i++)
					{
						String str=input.nextLine();
						System.out.println(str.substring(6,10)+'-'+str.substring(10,12)+'-'+str.substring(12,14));
					}
					break;
				default:
					System.out.println("exit");
					break;
			}
		}
	}
	
	private static int fib(int n)
	{
		if(n==1||n==2)
			return 1;
		else 
			return fib(n-1)+fib(n-2);
		
	}
}
